/*
 * EnigmaGM - A feature rich guild management system.
 * Copyright (C) 2007 ajiaojr.
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 */
package org.ajiaojr.enigmagm.client.section;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.StackPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * @author ajiaojr
 */
public class AtAGlanceSection extends Section {
  private static final AtAGlanceSection instance = new AtAGlanceSection();

  public static AtAGlanceSection getInstance() {
    return instance;
  }

  private AtAGlanceSection() {
    final HorizontalPanel mainPanel = new HorizontalPanel();
    initWidget(mainPanel);
    mainPanel.setWidth("100%");

    final VerticalPanel verticalPanel = new VerticalPanel();
    mainPanel.add(verticalPanel);
    mainPanel.setCellVerticalAlignment(verticalPanel,
        HasVerticalAlignment.ALIGN_TOP);
    verticalPanel.setWidth("100%");
    verticalPanel.setSpacing(6);

    Frame adFrame = new Frame(GWT.getModuleBaseURL() + "/ad.html");
    adFrame.setSize("200px", "350px");
    adFrame.setStyleName("adBox");

    mainPanel.add(adFrame);
    mainPanel.setCellVerticalAlignment(adFrame, HasVerticalAlignment.ALIGN_TOP);
    mainPanel.setCellHorizontalAlignment(adFrame,
        HasHorizontalAlignment.ALIGN_CENTER);
    mainPanel.setCellWidth(adFrame, "140px");
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.ajiaojr.enigmagm.client.section.Section#getName()
   */
  public String getName() {
    return "At a Glance";
  }
}
